from vec import *
import random
WIDTH = 600
HEIGHT = 440

BACK_COLOR = (0, 0, 0)
PEN_COLOR = (0, 200, 0)

rcHeight = [100, 120, 140, 160, 180, 200]
rcWidth = 20
space = 10
class MyRect:
    def __init__(self, lb_x, lb_y, h, clr):
        self.pos = Vec2(lb_x, lb_y)
        self.h = h
        self.clr = clr
        
    def Update(self):
        pass

    def Draw(self):
        rc = Rect((self.pos.x, self.pos.y - self.h), (rcWidth, self.h))
        screen.draw.filled_rect(rc, self.clr)

startX = 50
iter = startX
rcList = []
for item in rcHeight:
    r = random.randint(50, 200)
    g = random.randint(50, 200)
    b = random.randint(50, 200)
    rcList.append(MyRect(iter, HEIGHT / 2, item, (r, g, b)))
    iter += rcWidth
    iter += space

def update():
    pass

def draw():
    screen.clear()
    screen.fill(BACK_COLOR)
    screen.draw.line((0, HEIGHT / 2), (WIDTH, HEIGHT / 2), PEN_COLOR)
    for rc in rcList:
        rc.Draw()
